package com.dxy.chatserver.controller;

import com.dxy.chatserver.mapper.ChatMsgMapper;
import com.dxy.chatserver.service.MoveService;
import com.dxy.chatserver.service.TsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mongo")
@Slf4j
public class moveController {
    @Autowired
    private MoveService moveService;
    @Autowired
    private ChatMsgMapper chatMsgMapper;

/*    @GetMapping("/getDb")
    public void getDb(){
        chatMsgMapper.getDbList();
    }

    @GetMapping("/save")
    public void saveData(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime){
        moveService.saveData(startTime,endTime);
    }

    @GetMapping("/getData")
    public void getData(){
        TsService.getRange("[group]191");
    }*/

    @GetMapping("/save")
    public void saveData(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime){
        moveService.saveData(startTime,endTime);
    }
    @GetMapping("/getDb")
    public void getDb(){
        chatMsgMapper.getDbList();
    }

}
